<?php
// +----------------------------------------------------------------------
// | saiadmin [ saiadmin快速开发框架 ]
// +----------------------------------------------------------------------
// | Author: your name
// +----------------------------------------------------------------------
namespace app\activity\validate;

use think\Validate;

/**
 * 活动列表验证器
 */
class activityValidate extends Validate
{
    /**
     * 定义验证规则
     */
    protected $rule =   [
        'lang_code' => 'require',
        'activity_category_id' => 'require',
        'activity_cover' => 'require',
        'activity_start_time' => 'require',
        'province_id' => 'require',
        'activity_end_time' => 'require',
        'city_id' => 'require',
        'district_id' => 'require',
        'activity_address' => 'require',
        'is_display' => 'require',
        'activity_title' => 'require',
        'activity_details' => 'require',
    ];

    /**
     * 定义错误信息
     */
    protected $message  =   [
        'lang_code' => '语言代码必须填写',
        'activity_category_id' => '活动分类必须填写',
        'activity_cover' => '活动封面必须填写',
        'activity_start_time' => '活动开始时间必须填写',
        'province_id' => '省必须填写',
        'activity_end_time' => '活动结束时间必须填写',
        'city_id' => '市必须填写',
        'district_id' => '区必须填写',
        'activity_address' => '活动地址必须填写',
        'is_display' => '展示/下架必须填写',
        'activity_title' => '活动标题必须填写',
        'activity_details' => '活动详情必须填写',
    ];

    /**
     * 定义场景
     */
    protected $scene = [
        'save' => [
            'lang_code',
            'activity_category_id',
            'activity_cover',
            'activity_start_time',
            'province_id',
            'activity_end_time',
            'city_id',
            'district_id',
            'activity_address',
            'is_display',
            'activity_title',
            'activity_details',
        ],
        'update' => [
            'lang_code',
            'activity_category_id',
            'activity_cover',
            'activity_start_time',
            'province_id',
            'activity_end_time',
            'city_id',
            'district_id',
            'activity_address',
            'is_display',
            'activity_title',
            'activity_details',
        ],
    ];

}
